/*
 * @Description: 大前端学习
 * @Version: H5
 * @Author: Ajax
 * @Date: 2020-05-11 10:01:07
 * @LastEditors: Ajax
 * @LastEditTime: 2020-05-11 18:47:28
 */

// 运行游戏和功能
; (function () {
    let $beginBtn = document.querySelector('.begin')
    let $stop = $beginBtn.nextElementSibling
    let $map = document.querySelector('.map')
    $beginBtn.addEventListener('click', () => {
        let game = new Game($map)
        game.start()
    })
    $stop.addEventListener('click', () => {
        if (time) {
            clearInterval(time)
            $stop.innerHTML = '继续游戏'
        } else {
            $stop.innerHTML = '暂停游戏'
        }
    })
})()